﻿#ifndef REGISTRATIONALGORITHM_H
#define REGISTRATIONALGORITHM_H

#include <QObject>

namespace Core {

	class RegistrationAlgorithm : public QObject
	{
		Q_OBJECT

	public:
		explicit RegistrationAlgorithm(QObject *parent = nullptr);
		~RegistrationAlgorithm();

		/**
		 * @brief getMachineCode 获取机器码
		 * @return
		 */
		QString getMachineCode();

		/**
		 * @brief	generateRegistrationCode 生成注册码
		 * @param	strEndDate 注册截止时间
		 * @param	strMachineCode 机器码
		 * @return
		 */
		QString generateRegistrationCode(QString strEndDate, QString strMachineCode);

		/**
		* @brief	writeRegistrationCode 写入软件注册码
		* @param	strRegistrationCode 注册码
		* @return
		*/
		bool writeRegistrationCode(QString strRegistrationCode);

		/**
		* @brief verifyRegistrationCode 校验注册码
		* @param strRegistrationCode
		* @return
		*/
		bool verifyRegistrationCode(QString strRegistrationCode);

		/**
		 * @brief	verifyRegistration 校验是否注册
		 * @return 
		 */
		bool verifyRegistration();

	private:
		/**
		 * @brief	getCPUId 获取CPUId
		 * @return 
		 */
		QString getCPUId();

		/**
		 * @brief	getMacId 获取网络MacId
		 * @return 
		 */
		QString getMacId();

		/**
		 * @brief	getSystemId 获取系统Id
		 * @param	cmd cmd指令
		 * @return 
		 */
		QString getSystemId(const QString &cmd);

		/**
		 * @brief	getBaseUUid 获取电脑主板Id
		 * @return 
		 */
		QString getBaseUUid();

	};

}//namespace Core

#endif // REGISTRATIONALGORITHM_H